package main

import "fmt"

type Phone struct {
	price int
	color string
}

//type Iphone struct {
//	phone  Phone
//	mobile string
//}
//
//func main() {
//
//	var p Iphone
//	p.phone.price = 10
//	p.phone.color = "red"
//	p.mobile = "s4"
//	fmt.Println(p.phone)
//	fmt.Println(p.mobile)
//}

func (phone Phone) ring() {
	fmt.Println(`phone is ringing`)
}

type Iphone struct {
	Phone
	mobile string
}

func main() {
	var p Iphone
	p.price = 10
	p.color = `red`
	p.mobile = `3s`

	fmt.Println(p.price, `---`, p.color, `-----`, p.mobile)
	p.ring()
}
